package unify.gui;

//import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.SimpleFormatter;

//import javax.swing.JOptionPane;

//This custom formatter formats parts of a log record to a single line
public class GUIAlert extends SimpleFormatter {

	// This method is called for every log records
	public String format(LogRecord record) {
		//This must be moved to it's own thread, like all guis usually are.
		
		/*if (record.getLevel().intValue() == Level.WARNING.intValue()) {
			//Doesn't use the appropriate look and feel, to be fixed, probably to be a call to another class
			JOptionPane.showMessageDialog(null, formatMessage(record), "Warning", JOptionPane.WARNING_MESSAGE);
		} else if (record.getLevel().intValue() == Level.SEVERE.intValue()) {
			//Doesn't use the appropriate look and feel, to be fixed, probably to be a call to another class
			JOptionPane.showMessageDialog(null,formatMessage(record) + "\nPlease close the program and restart.", "Severe Error", JOptionPane.ERROR_MESSAGE);
		}*/
		return super.format(record);
	}
}
